#include "leftwidget.h"
#include "ui_leftwidget.h"

LeftWidget::LeftWidget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::LeftWidget)
{
    ui->setupUi(this);
    QFile mainFile(":/qss/AlertManager.qss");
    if (mainFile.open(QFile::ReadOnly)) {
        QString styleSheet = QLatin1String(mainFile.readAll());
        this->setStyleSheet(styleSheet);
        qDebug() <<"AlertManager QSS打开成功";
    }else{
        qDebug() <<"AlertManager QSS打开失败";
    }
    connect(ui->rulerBtn, &QPushButton::clicked, this, &LeftWidget::onRuleBtnClick);
    connect(ui->noticeBtn, &QPushButton::clicked, this, &LeftWidget::onNoticeBtnClick);
    connect(ui->recordBtn, &QPushButton::clicked, this, &LeftWidget::onRecordBtnClick);
}

LeftWidget::~LeftWidget()
{
    delete ui;
}

void LeftWidget::onRuleBtnClick()
{
    emit showAlertManger();
}

void LeftWidget::onNoticeBtnClick()
{
    emit showAlertNotice();
}

void LeftWidget::onRecordBtnClick()
{
    emit showAlertRecord();
}
